import 'package:cloud_medicine/model/comment_item_info.dart';

// 评论总信息
class CommentInfo {
  final String comment_num;
  final List<CommentItemInfo> data;

  CommentInfo({
    this.comment_num,
    this.data,
  });

  factory CommentInfo.init(Map<String, dynamic> json) {
    List<CommentItemInfo> getList(List list) {
      List<CommentItemInfo> arr = [];
      list.forEach((item){
        arr.add(CommentItemInfo.init(item));
      });
      return arr;
    }
    return CommentInfo(
      comment_num: json['comment_num'],
      data: getList(json['data'])
    );
  }
}
